package edu.sctu.wangfuxin.day20150526;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user06 on 2015/5/26.
 */
public class AddList {

    public List<String> steAddList() {
        List<String> list = new ArrayList<String>();
        list.add("张三");
        list.add("王二麻子");
        list.add(0, "李四");
        return list;
    }

    public List<String> print_List() {
        List<String> list = steAddList();
//        for (int i = 0; i < list.size(); i++) {
//            System.out.println(list.get(i));
//        }
//foreach遍历
        for (String s : list) {
            System.out.println(s);
        }
        return list;
    }

    public static void main(String[] args) {
        new AddList().print_List();
    }
}
